package com.ht.base.system.biz.client.impl;

import com.ht.base.system.biz.manager.OnOffConfManager;
import com.ht.base.system.client.OnOffConfClient;
import com.ht.base.system.common.pojo.bo.OnOffConfBO;
import com.ht.base.system.common.pojo.qto.OnOffConfQTO;
import org.apache.dubbo.config.annotation.DubboService;
import org.base.common.appexception.ResultData;
import org.base.common.page.PageBO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author：hdengxian
 * @Date：2024/3/28 15:26
 */
@Component
@DubboService
public class OnOffConfClientImpl implements OnOffConfClient {
    Logger logger = LoggerFactory.getLogger(OnOffConfClientImpl.class);
    @Resource
    private OnOffConfManager onOffConfService;


    @Override
    public ResultData<Integer> insertData(OnOffConfBO onOffConfBO) {
        Integer data = onOffConfService.insertData(onOffConfBO);
        return new ResultData<>(data);
    }

    @Override
    public ResultData<Boolean> updateDataById(OnOffConfBO onOffConfBO) {
        Boolean data = onOffConfService.updateDataById(onOffConfBO);
        return new ResultData<>(data);
    }

    @Override
    public ResultData<Boolean> deleteById(Long id) {
        Boolean data = onOffConfService.deleteById(id);
        return new ResultData<>(data);
    }

    @Override
    public ResultData<Boolean> deleteByIds(Long[] ids) {
        Boolean data = onOffConfService.deleteByIds(ids);
        return new ResultData<>(data);
    }

    @Override
    public ResultData<OnOffConfBO> findById(Long id) {
        return new ResultData<>(onOffConfService.findById(id));
    }

    @Override
    public ResultData<PageBO<OnOffConfBO>> findDataForPage(OnOffConfQTO qto) {
        return new ResultData<>(onOffConfService.findDataForPage(qto));
    }
}
